import request from '@/utils/request.js'
// 状态数据
const state = {
	categoryInfo: {}
}
const actions = {
	// 获取分类详情页数据
	async getCategoryInfo({commit}, val) {
		const res = await request(`/categoryInfo/${val}`)
		console.log(res);
		commit('GET_CATEGORY_INFO', res.categoryInfo.data)
	}
}
const mutations = {
	GET_CATEGORY_INFO(state, val) {
		state.categoryInfo = val
	}
}
const getters = {
	// 商家列表
	poilist: state => state.categoryInfo.poilist
}

export default {
	state, actions, mutations, getters
}